<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta http-equiv="keywords" content="" />
		<meta http-equiv="description" content="" />
		<title>コントロールパネル</title>

		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<script src="assets/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript">
		$(function() {
			$('#text-date1').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			$('#text-date2').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
		});
		</script>


		<link type="text/css" href="./assets/styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		
		<script type="text/javascript">
		$(function() {
			// メッセージのフェード
			$('.message').fadeIn("slow");
			
			$('#btn_search').click(function(){
				document.fm.submit();
			});

			$('#btn_csv').click(function(){
				document.fm.action = 'ship_csv.php';
				document.fm.submit();

				document.fm.action = 'ship_index.php';
			});
			
		});

		function print_preview( id ){
			var url = './preview/shipping.php?id=' + id;
			window.open(url, 'printpreview');
		}

		</script>
		
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>


	</head>
	<body id="">
{{ php }} include( MENU_FILE ); {{ /php }}

		<div id="header" class="clearfix"><div class="wrapper">
			<h1><a href="./">コントロールパネル</a></h1>
			<form id="form_logout" action="logout.php" method="post"><p>{{ $login.staff_name }} <input type="submit" id="button_logout" value="ログアウト" /></p></form>
		</div></div>
		<div id="container"><div class="wrapper">

			<h2>サンプル依頼</h2>

			<ul class="submenu clearfix">
				<li><a href="sample_index.php">サンプル依頼書一覧</a></li>
				<li><a href="sample_form.php">サンプル依頼書登録</a></li>
				<li><a href="ship_index.php">無償出荷一覧</a></li>
				<li><a href="ship_form.php">無償出荷登録</a></li>
				<li><a href="products_index.php">商品マスタ</a></li>
			</ul>


			<h3>無償出荷一覧</h3>
			<p class="message">条件を入力し、検索ボタンをクリックしてください。</p>

			<form name="fm" method="get" action="ship_index.php" >

				<table class="formTable">
					<tbody>
						<tr>
							<th>キーワード検索</th>
							<td>
								<input type="text" name="keyword" id="text_contents" class="text" value="{{ $forms.keyword }}" />
								<p class="note">製品名/納品先/依頼者名で検索ができます。</p>
							</td>
						</tr>
						<tr>
							<th>伝票区分</th>
							<td>
{{ html_options name=denpyo options=$arr_denpyo selected=$forms.denpyo }}
							</td>
						</tr>
						<tr>
							<th>登録日</th>
							<td>
								<input type="text" name="date1" id="text-date1" class="text" value="{{ $forms.date1 }}" /> ～ <input type="text" name="date2" id="text-date2" class="text" value="{{ $forms.date2 }}" />
							</td>
						</tr>
						<tr>
							<th>フォロー記入</th>
							<td>
{{ html_checkboxes name=follow options=$arr_follow selected=$forms.follow }}
							</td>
						</tr>
					</tbody>
				</table>

				<p class="button">
					<button type="button" id="btn_search" class="submit"><span>検索</span></button>
				</p>

			</form>

			<p class="message">{{ $page.cnt }}件登録されています。</p>

			<table id="inquiry_result" class="sortable">
				<thead>
					<tr>
						<th class="nosort"><h3>ID</h3></th>
						<th class="nosort"><h3>依頼者名</h3></th>
						<th class="nosort"><h3>納品先会社名</h3></th>
						<th class="nosort"><h3>登録日時/更新日時</h3></th>
						<th class="nosort"><h3>印刷画面</h3></th>
						<th class="nosort"><h3>参照</h3></th>
					</tr>

				</thead>
				<tbody>
{{ foreach from=$data key=k item=v }}
					<tr>
						<td><a href="ship_preview.php?id={{ $v.id }}">{{ $v.disp_id }}</a></td>
						<td>{{ $v.request_name }}</td>
						<td>{{ $v.company }}</td>
						<td>{{ $v.r_date }}<br />{{ $v.u_date }}</td>
						<td><a href="javascript:print_preview({{ $v.id }})">[印刷画面]</a></td>
						<td><a href="ship_preview.php?id={{ $v.id }}">[参照]</a></td>
					</tr>
{{ /foreach }}
				</tbody>
			</table>

			<p align="center">
{{ if $page.current > 1 }}
				<a href="ship_index.php?page={{ $page.current-1 }}{{ $page.query }}">前の{{ $page.item }}件</a>&nbsp;&nbsp;
{{ /if }}
{{ foreach from=$page.paging key=k item=v }}
{{ if $v < $page.current+15 }}
{{ if $page.current == $v }}
{{ $v }}&nbsp;
{{ else }}
				<a href="ship_index.php?page={{ $v }}{{ $page.query }}">{{ $v }}</a>&nbsp;
{{ /if }}
{{ /if }}
{{ /foreach }}
{{ if $page.end > $page.current }}
				<a href="ship_index.php?page={{ $page.current+1 }}{{ $page.query }}">次の{{ $page.item }}件</a>
{{ /if }}
			</p>

{{ if $page.cnt }}
			<p class="button">
				<button type="button" id="btn_csv" class="submit"><span>CSV出力</span></button>
			</p>
{{ /if }}
		</div></div>
		<address>Copyright (C) SHIFT Inc. / All rightes reserved</address>

	</body>
</html>